/* 弹框标题 */
import "package:flutter_screenutil/flutter_screenutil.dart";
import 'package:flutter/material.dart';

class ModalTitle extends StatelessWidget {
  final String title;
  final num margin;
  final dynamic Function() onPressed;

  const ModalTitle(
      {required this.title, required this.onPressed, this.margin = 80});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(bottom: margin.sp),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Text(
            title,
            style: TextStyle(
                color: Colors.black,
                fontSize: 56.sp,
                fontWeight: FontWeight.w600),
          ),
          IconButton(
              icon: Icon(
                Icons.close,
                color: Color.fromRGBO(204, 204, 204, 1),
                size: 66.sp,
              ),
              onPressed: onPressed)
        ],
      ),
    );
  }
}
